home *** CD-ROM | disk | FTP | other *** search
/ PC Media 4 / PC MEDIA CD04.iso / share / jwin / shihtao / stepone.app < prev    next >
INI File  |  1993-08-29  |  9KB  |  270 lines

  1. [StepOne] 
  2. ' ----- APPLICATIONSTART ----------------------------------------------------------
  3. ' This application controls StepOne installation interpreter from 
  4. ' Markus Kreisel and Renate Reinartz.
  5. ' Vendor: See Program
  6. ' Please don't change this file!!
  7. ' ---------------------------------------------------------------------------------------
  8.  
  9. language "windows"        ' initialisize language
  10. if "win" 310
  11.     void
  12.     goto This_version_don┤t_works_with_Win300_sorrymessage
  13.  
  14. gosub init                      ' intitialisation
  15. gosub welcome            ' welcome screen
  16. gosub check_lib                 ' check for libs
  17. gosub app_active        ' check, if Shih Tao is loaded
  18. gosub select_path        ' select path for installation
  19. gosub copy            ' copy files
  20. gosub progman            ' install icons in Program Manager
  21. gosub iniedit            ' edit the shihtao.ini
  22. gosub complete            ' installation complete
  23. gosub cleanup            ' cleanup temp files
  24. end
  25. ' ----- PROGRAM END --------------------------------------------------------------------
  26.  
  27.  
  28. ' ----- Subroutines ------------------------------------------------------------------
  29. [init]
  30. {
  31.     Copyright            ' show copyright dialog
  32.     
  33.     language english    
  34.             
  35.     let "version" 1,50    
  36.     let "prg" shihtao
  37.     let "prgname" Shih Tao
  38.     
  39.     color 12            ' 12 = light red
  40.     txtsize 10            ' initialize font size
  41.     
  42.     target "" windows        ' initialize target path
  43.     source "" runpath        ' initialize source path
  44.     let "copyspace" 300000         ' length of files to copy
  45.     
  46.     space "0" windows        ' length of files to copy in Windows path
  47.     space "70000" system        ' length of files to copy in System path
  48.     space "400000" target        ' length of files to copy in target path
  49.         
  50. }
  51. ' ---------------------------------------------------------------------------------------
  52. [welcome]
  53. {
  54.     gosub load_picture shihinst.rl_ shihinst.rle
  55.     banner "Welcome..."
  56.     wndshow "{prgname} Installation"
  57.     wndtxt "Welcome to installation@of {prgname} version {version} for Windows." ok
  58. }
  59. ' ---------------------------------------------------------------------------------------
  60. [check_lib]
  61. {
  62.     banner "Check libs"        
  63.     wndtxt "Shih Tao needs Custom Controls from the threed.vbx file in your system directory. " +
  64.     wndtxt "Some installations copy this libraries into the windows " +
  65.     wndtxt "directory of your system. This isn┤t the correct location. " +
  66.     wndtxt "StepOne is able to move the needed Controls from " +
  67.     wndtxt "windows directory to system directory. " +
  68.     wndtxt "StepOne will ask for permission before moving threed.vbx. " +
  69.     wndtxt "While moving StepOne checks the file for version info and date. " +
  70.     wndtxt "After the installation you will find the newest Version of " +
  71.     wndtxt "threed.vbx in your windows directory." ok
  72.  
  73.     gosub lib_verify threed.vbx
  74. }
  75. [lib_verify]
  76. parameter dateiname
  77. {
  78.     
  79.     gosub task_verify {lib_verify.dateiname}
  80.  
  81.     exist "[windows]\{lib_verify.dateiname}"
  82.         void
  83.         return
  84.  
  85.     selection "Move ┤{lib_verify.dateiname}┤?~Yes~No~[END]~0~1" variable
  86.     if "{variable}" 0
  87.         void
  88.         return
  89.  
  90.     copy "[windows]\{lib_verify.dateiname}~[system]\{lib_verify.dateiname}~"
  91.     del "[windows]\{lib_verify.dateiname}"
  92. }
  93.  
  94. [task_verify]
  95. parameter dateiname
  96. {
  97.  
  98.     [retry]
  99.     taskactive "{task_verify.dateiname}"
  100.         void
  101.         Return
  102.  
  103.     askbox "{task_verify.dateiname} is in use. Cancel the Task using the file then press OK. Cancel will stop the installation."
  104.         goto retry
  105.         gosub ins_cancel
  106.     
  107. }
  108.  
  109. [select_path]
  110. {
  111.     banner "Select target path"
  112.     wndtxt "StepOne will copy files to your harddisk. " +
  113.     wndtxt "Please select the path where {prgname} should be installed. " cont
  114.     target "" windows
  115.     cd ".."
  116.     iniread "[windows]\win.ini~KRS~{prg}Path~[target]\{prg}"
  117.     inputbox "Select target path~Please select a path:~[stack]" path
  118.     target "" stack
  119.     iniedit "[windows]\win.ini~KRS~{prg}Path~[stack]"
  120. }
  121.  
  122. ' ---------------------------------------------------------------------------------------    
  123. [app_active]
  124. {
  125.     taskactive "[target]\{prg}.exe"
  126.     goto prg_active
  127.     goto prg_not_active
  128.     [prg_active]
  129.     banner "{prgname} aktive"
  130.     wndtxt "" delete
  131.     askbox "{prgname} is aktive. Choose `Yes` to close " +
  132.     askbox "{prgname} or `No` to exit installation." yes
  133.         taskclose "{prg}.exe"
  134.         goto ins_cancel
  135.     taskactive "[target]\{prg}.exe"
  136.         goto prg_active
  137.         goto prg_not_active
  138.     [prg_not_active]
  139.     banner "Copying..."
  140.     wndtxt "" delete
  141. }
  142. ' ---------------------------------------------------------------------------------------
  143. [copy]
  144. {
  145.     copygo "{copyspace}"
  146.         copy "[source]\{prg}.ex_~[target]\{prg}.exe~The program.@You┤ll play it day and night."
  147.         copy "[source]\{prg}.hl_~[target]\{prg}.hlp~Onlinehelp. Here you┤ll find help for all situation (especially for {prgname})."
  148.         copy "[source]\shresdll.dl_~[target]\shresdll.dll~
  149.         copy "[source]\{prg}.rl_~[target]\{prg}.rle~
  150.         copy "[source]\readme.txt~[target]\readme.txt~"
  151.         copy "[source]\threed.vb_~[system]\threed.vbx~
  152.         cd "symbol"
  153.         gosub symbol_copy shihtao
  154.         gosub symbol_copy quadro
  155.         gosub symbol_copy modern
  156.         gosub symbol_copy far_east
  157.         cd ".."
  158.     copystop 
  159.     copystatus
  160.         void
  161.         gosub copyerror
  162. }
  163. ' ---------------------------------------------------------------------------------------
  164. [symbol_copy]
  165. parameter q
  166. {
  167.     copy "[source]\{symbol_copy.q}._~[target]\{symbol_copy.q}~Different sets of symbols."
  168.     copy "[source]\{symbol_copy.q}.2_~[target]\{symbol_copy.q}.2~"
  169.     copy "[source]\{symbol_copy.q}.3_~[target]\{symbol_copy.q}.3~"
  170.     copy "[source]\{symbol_copy.q}.4_~[target]\{symbol_copy.q}.4~"
  171.     copy "[source]\{symbol_copy.q}.5_~[target]\{symbol_copy.q}.5~"
  172.     copy "[source]\{symbol_copy.q}.6_~[target]\{symbol_copy.q}.6~"
  173. }
  174. ' ---------------------------------------------------------------------------------------
  175. [progman]
  176. {
  177.     banner "Install icons..."
  178.     wndtxt "Installation program will install icons in " +
  179.     wndtxt "Windows Program Manager. " +
  180.     wndtxt "During installation of icons installation screen " +
  181.     wndtxt "will be hidden..." ok
  182.     wndhide
  183.     wndtxt "" delete
  184.     prgmanreplace "[target]\{prg}.exe~KRS~{prgname} for Windows" 
  185.     prgmanreplace "[target]\readme.txt~KRS~{prgname} last infos"
  186.     wndshow
  187. }
  188. ' ---------------------------------------------------------------------------------------
  189. [iniedit]
  190. {
  191.     
  192.     iniedit "[windows]\win.ini~Extensions~ga,~[target]\{prg}.exe ^.gam"
  193.     iniedit "[target]\{prg}.ini~{prg}~SymbolPath~[target]\symbol"    
  194.     iniedit "[target]\{prg}.ini~{prg}~GameFilesPath~[target]\gam"
  195.     RegBaseEdit ".GAM~ShihTaoGame"
  196.     RegBaseEdit "ShihTaoGame~{prgname} Game file"
  197.     RegBaseEdit "ShihTaoGame\shell\open\command~[target]\{prg}.exe"
  198.     RegBaseEdit "ShihTaoGame\shell\open\ddeexec~open %1"
  199.     RegBaseEdit "ShihTaoGame\shell\open\ddeexec\application~{prg}"
  200.     RegBaseEdit "ShihTaoGame\shell\open\ddeexec\topic~shibrett"
  201.     
  202. }
  203. ' ---------------------------------------------------------------------------------------
  204. [complete]
  205. {
  206.     exist "[target]\{prg}.exe"
  207.         void
  208.         goto ins_error
  209.     wndshow
  210.     banner "Last news"
  211.     wndtxt "[target]\readme.txt" file    
  212.     banner "Heureka..."
  213.     wndtxt "Installation is successfully completed.@" +
  214.     wndtxt "Start {prgname} with a doubleclick on {prgname} icon " +
  215.     wndtxt "in Program Manager group {gruppe}.@@" 
  216.     wndtxt "Note: After ending StepOne there may be a short break, when " +
  217.         wndtxt "program LastStep deletes temp files for installation." end
  218.     wndhide
  219. }
  220. ' ---------------------------------------------------------------------------------------
  221. [copyerror]
  222. {
  223.     banner "Ouch..."
  224.     wndtxt "Program end.@" +
  225.     wndtxt "Not all files could be copied." +
  226.     wndtxt "Perhaps {prgname} will not work correctly." ok
  227.     goto ins_error
  228. }
  229. ' ---------------------------------------------------------------------------------------
  230. [load_picture]
  231. parameter p1,p2
  232. {
  233.     copy "[source]\{load_picture.p1}~[temp]\{load_picture.p2}~" 
  234.     picload "[temp]\{load_picture.p2}"
  235.     del "[temp]\{load_picture.p2}" 
  236. }
  237.  
  238. [This_version_don┤t_works_with_Win300_sorrymessage]
  239. {
  240.     Msgbox "{prgname} requires at least Windows 3.1. Installation will be canceled." OK
  241.     goto ins_error
  242. }
  243.  
  244. [cleanup]
  245. {
  246.     shell "[source]\laststep.exe~[windows]\stepone.exe [windows]\soresdll.dll"
  247. }
  248.  
  249. ' --- SYSTEMLABEL -----------------------------------------------------------------------
  250. [ins_error]
  251.     wndshow "Error"
  252.     beep 1
  253.     banner "Error!"
  254.     wndtxt "There is an error accounted. " +
  255.     wndtxt "Restart Windows and try again." OK
  256.     wndtxt "If the problems will accounted again, please ask " +
  257.     wndtxt "the support:@Markus Kreisel & Renate Reinartz@Homburger Str. 22@50969 Koeln@Federal Republic of Germany@CompuServe 100116,2133@@or ask your vendor" end
  258.     gosub cleanup
  259.     end
  260. ' ---------------------------------------------------------------------------------------
  261. [ins_cancel]
  262.     wndshow "Error"
  263.     beep 1
  264.     banner "Cancel!"
  265.     wndtxt "You have canceled installation. {prgname} will " +
  266.     wndtxt "not work properly. " end
  267.     gosub cleanup
  268.     end
  269. ' ---------------------------------------------------------------------------------------
  270.